package com.sean.controller;

import com.sean.entity.Student;
import com.sean.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/student/{id}")
    Student getById(@PathVariable long id) {
        System.out.println(id);
        return studentService.getNameById(id);
    }
}
